<template>
	<view>
		<view class="P_3 flex_row_between">
			
			
				<view class="PTB_3 flex_colC bg_fff B_radius_5 W_44vw">
					<view class="font_weight_bold fontS_18" style="display: flex;align-items: flex-end;">
						<view class="font_weight_bold fontS_16">
							{{info.childCount}}
						</view>
						<view class="fontS_10 PL_1">
							个
						</view>
					</view>
					<view class="PT_1">
						直推人数
					</view>
				</view>
				
			
			
				<view class="PTB_3 flex_colC bg_fff B_radius_5 W_44vw">
					<view class="font_weight_bold fontS_18" style="display: flex;align-items: flex-end;">
						<view class="font_weight_bold fontS_16">
							{{info.childrenCount}}
						</view>
						<view class="fontS_10 PL_1">
							个
						</view>
					</view>
					<view class="PT_1">
						社区总人数
					</view>
				</view>
				
				
			
		</view>
		
		<view class="PTB_3 bg_fff P_1 MLR_3 B_radius_5 flex_row_between PLR_1">
			<view class="flex_rowC" style="width: 50%;">
				社区撮合总量：{{Number(info.teamAmount).toFixed(2)}}
			</view>
			<view class="H_6vw bg_000" style="width: 1px;">
				
			</view>
			<view class="flex_rowC" style="width: 50%;">
				社区总奖励：{{Number(info.teamRebate).toFixed(2) }}
			</view>
		</view>
		
		
		
		<view class="bg_fff MT_4">
			<view class="pub_color font_weight_bold fontS_18 PLR_2 PTB_2 line_bom">
				直推列表
			</view>
			<view class="flex_row_between PLR_2 PTB_3 color_gray font_weight_bold line_bom">
				<view class="W_22vw flex_rowL fontS_10">
					账号
				</view>
				<view class="W_22vw flex_rowC fontS_10">
					社区人数(人)
				</view>
				<view class="W_22vw flex_rowR fontS_10">
					撮合总量(KSA)
				</view>
				<view class="W_22vw flex_rowR fontS_10">
					社区奖励(KSA)
				</view>
			</view>
			<view @click="uOpenWin('./babyReord?name='+item.name+'&&id='+item.id)" v-for="(item,index) in list" :key="index" class="flex_row_between PLR_2 PTB_3 fontS_12 line_bom">
				<view class="W_22vw flex_rowL">
					<view class="PL_1 color_gold vip flex_rowC">
						lv.{{item.level}}
					</view>
					<view class="">
						{{item.name}}
					</view>
					
					
				</view>
				<view class="W_22vw flex_rowC">
					{{item.childrenCount}}
				</view>
				<view class="W_22vw flex_rowR">
					{{item.totalAmount}}
				</view>
				<view class="W_22vw flex_rowR">
					<view class="PR_2">
						{{item.totalRebate}}
					</view>
					<image class="WH_4vw" src="../../static/goyou.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				idx:1,
				list:[],
				page:1,
				showText:'',
				state:true,
				info:{}
			}
		},
		onReachBottom() {
			if (this.state) {
				this.showTxt = '加载中...';
				this.page++
				this.getList();
			}
		},
		onPullDownRefresh() {
			//this.getSorts();
			this.getInfo()
			this.getList();
			console.log('refresh');
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		onLoad() {
			this.getList();
			this.getInfo()
		},
		methods: {
			getInfo(){
				let _this = this;
				this.$req('team/info',{},function(res){
					_this.info = res.data;
					//console.log(res)
				})
			},
			getList(){
				let _this = this;
				this.$req('team/index',{page:_this.page,scene:_this.idx},(res)=>{
					if(res.code==1){
						if(res.data.list && res.data.list.length>0){
							if(_this.page==1){
								_this.list = res.data.list;
							}else{
								_this.list = _this.list.concat(res.data.list)
							}
						}else{
							_this.showText = '没有更多了';
							_this.state = false;
						}
					}else{
						_this.toast(res.msg)
					}
				})
			},
			tabClick(i){
				let _this = this;
				this.idx = i;
				this.list = [];
				this.getList()
			}
		}
	}
</script>

<style>
.top{
	padding-top:var(--status-bar-height);
}
.vip{
	background-image: url(../../static/vip.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	padding: 0.1vw 1vw;
}
</style>
